Skip to content

fix(pm-stack): stamp sent_at on send ledger, repair legacy rows, alarm on all-excluded (#14419) - #14574

Open
dezren39 wants to merge 1 commit into
mainfrom
xaltha/14419-send-ledger-sent-at
Open

dezren39 wants to merge 1 commit into
mainfrom
xaltha/14419-send-ledger-sent-at

Conversation

@dezren39

@dezren39 dezren39 commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Slice of #14419 (Refs #14419, parent #14061).

  • AlertsStore.logSend now stamps sent_at explicitly in ISO-8601 UTC on every new ledger row (injectable sentAt for tests), instead of relying on the unparseable created_at column default.
  • Reader: normalizeSendTimestamp accepts the legacy column-default format live rows carry (YYYY-MM-DD HH:MM:SS[.fff], space separator, no zone — UTC by construction) plus Postgres-style offsets; sendTimestamp falls back to normalized created_at when sent_at is absent/unusable, and repairLegacySendRow backfills sent_at for recoverable legacy rows. Unrecoverable rows stay excluded and are counted as undated, with the reason recorded on the notifications page.
  • Alarm: the roll-up now reports total and alarm (true when excluded == total and total > 0); the notifications page renders an ALARM banner in that case instead of silently reporting no sends.

Tests (done check): a test writes a send through logSend and reads it back through sendTimestamp/the roll-up; a legacy-format test covers normalization + backfill; an all-undated test covers the alarm. Verification: remote dispatch via the fleet-command workflow fallback (dispatch itself is blocked by TLS defect #13185) — run https://github.com/developing-today/fleet/actions/runs/45474489791 for bun test test/notifications.test.ts on this branch; result will be noted on #14419.

Legacy live-row data repair: with the reader normalization, the 269 legacy rows whose created_at is in the default format become readable in-place (repaired on read / backfillable via repairLegacySendRow); rows with no recoverable timestamp remain explicitly excluded + alarmed, per the issue's repair-or-exclude criterion.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-24T19:50:58Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch/workspace/github-work/code-14419",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch/workspace/github-work/code-14419",
      "repo": "developing-today/code",
      "branch": "xaltha/14419-send-ledger-sent-at",
      "sha": "965fb75a19c34ad9887fc1961039f6320de00161"
    },
    "auth_subject": "xaltha",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Get evidence
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 13 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0055f5cb-4a51-47f0-a40f-43bba274d996
Commits

Reviewing files that changed from the base of the PR and between 697fb3b and 965fb75.

Files selected for processing: 4

  • pm-stack/aggregator/src/alerts.ts
  • pm-stack/aggregator/src/notifications.ts
  • pm-stack/aggregator/src/render.ts
  • pm-stack/aggregator/test/notifications.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant